/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import demo_login.NewJFrame_add;
import demo_login.NewJFrame_delet;
import demo_login.NewJFrame_find;
import javax.swing.JOptionPane;

/**
 *
 * @author C079
 */
public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    public MainFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu_select = new javax.swing.JMenu();
        jMenuItem_save = new javax.swing.JMenuItem();
        jMenuItem_exit = new javax.swing.JMenuItem();
        jMenu_edit = new javax.swing.JMenu();
        jMenu_find = new javax.swing.JMenu();
        jMenuItem_nameFind = new javax.swing.JMenuItem();
        jMenuItem_idFind = new javax.swing.JMenuItem();
        jMenuItem_add = new javax.swing.JMenuItem();
        jMenuItem_update = new javax.swing.JMenuItem();
        jMenuItem_delete = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMenu_help = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jMenu_select.setText("选项");

        jMenuItem_save.setText("保存");
        jMenu_select.add(jMenuItem_save);

        jMenuItem_exit.setText("退出");
        jMenuItem_exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_exitActionPerformed(evt);
            }
        });
        jMenu_select.add(jMenuItem_exit);

        jMenuBar1.add(jMenu_select);

        jMenu_edit.setText("编辑");

        jMenu_find.setText("查找");

        jMenuItem_nameFind.setText("姓名");
        jMenuItem_nameFind.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_nameFindActionPerformed(evt);
            }
        });
        jMenu_find.add(jMenuItem_nameFind);

        jMenuItem_idFind.setText("学号");
        jMenuItem_idFind.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_idFindActionPerformed(evt);
            }
        });
        jMenu_find.add(jMenuItem_idFind);

        jMenu_edit.add(jMenu_find);

        jMenuItem_add.setText("添加");
        jMenuItem_add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_addActionPerformed(evt);
            }
        });
        jMenu_edit.add(jMenuItem_add);

        jMenuItem_update.setText("修改");
        jMenuItem_update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_updateActionPerformed(evt);
            }
        });
        jMenu_edit.add(jMenuItem_update);

        jMenuItem_delete.setText("删除");
        jMenuItem_delete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_deleteActionPerformed(evt);
            }
        });
        jMenu_edit.add(jMenuItem_delete);
        jMenu_edit.add(jSeparator1);

        jMenuBar1.add(jMenu_edit);

        jMenu_help.setText("帮助");

        jMenuItem1.setText("查看帮助");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu_help.add(jMenuItem1);

        jMenuItem3.setText("关于");
        jMenu_help.add(jMenuItem3);

        jMenuBar1.add(jMenu_help);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 439, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 171, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
//退出菜单项 
    private void jMenuItem_exitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_exitActionPerformed
        JOptionPane.showMessageDialog(null, "已退出");
        System.exit(0);//退出程序
    }//GEN-LAST:event_jMenuItem_exitActionPerformed

    private void jMenuItem_updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_updateActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem_updateActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem_addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_addActionPerformed
        new NewJFrame_add().setVisible(true);
    }//GEN-LAST:event_jMenuItem_addActionPerformed

    private void jMenuItem_deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_deleteActionPerformed
        new NewJFrame_delet().setVisible(true);//新建了一个窗体，并显示
    }//GEN-LAST:event_jMenuItem_deleteActionPerformed

    private void jMenuItem_nameFindActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_nameFindActionPerformed
        new NewJFrame_find().setVisible(true);
                
    }//GEN-LAST:event_jMenuItem_nameFindActionPerformed

    private void jMenuItem_idFindActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_idFindActionPerformed
        new NewJFrame_find().setVisible(true);
    }//GEN-LAST:event_jMenuItem_idFindActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem_add;
    private javax.swing.JMenuItem jMenuItem_delete;
    private javax.swing.JMenuItem jMenuItem_exit;
    private javax.swing.JMenuItem jMenuItem_idFind;
    private javax.swing.JMenuItem jMenuItem_nameFind;
    private javax.swing.JMenuItem jMenuItem_save;
    private javax.swing.JMenuItem jMenuItem_update;
    private javax.swing.JMenu jMenu_edit;
    private javax.swing.JMenu jMenu_find;
    private javax.swing.JMenu jMenu_help;
    private javax.swing.JMenu jMenu_select;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
